<tc_include file="Public:head" />
<body ontouchstart style="background: #ebebeb;">
<div class="container" id="container">
    <div class="page">
        <div class="page__bd" style="height: 100%; overflow: hidden;">
            <div class="weui-tab">
                <div class="weui-tab__panel">
                    <div class="swiper-container">
                        <!--幻灯片img-->
                        <div class="swiper-wrapper">
                            <volist name="banners" id="banner">
                                <div class="swiper-slide"><a href="{$banner['banner_url']}"><img src="<php>echo '/'.C('UPLOADPATH').$banner['banner_img']</php>"></a></div>
                            </volist>
                        </div>
                        <!--幻灯片img end-->
                        <!-- Add Pagination -->
                        <div class="swiper-pagination"></div>
                    </div>
                    <div class="weui-tab" style="margin-top: 10px; height: auto;">
                        <!--menu-->
                        <div class="weui-navbar integral-menu">
                            <div class="weui-navbar__item <if condition="$sort==0">weui-bar__item_on</if>" name="btn_sort" sort="0">
                                <i class="icon iconfont icon-all"></i>
                                <span>全部福利<font>All Benefits</font></span>
                            </div>
                            <div class="weui-navbar__item <if condition="$sort==1">weui-bar__item_on</if>" name="btn_sort" sort="1">
                                <i class="icon iconfont icon-defaultsort"></i>
                                <span>默认排序<font>Default Sort</font></span>
                            </div>
                            <div class="weui-navbar__item <if condition="$sort==2">weui-bar__item_on</if>" name="btn_sort" sort="2">
                                <i class="icon iconfont icon-credit"></i>
                                <span>积分排序<font>Credit Sort</font></span>
                            </div>
                        </div>
                        <!--menu end-->
                        <!--list-->
                        <div class="integral-list">
                            <volist name="coupons" id="coupon">
                                <div class="weui-flex__item">
                                    <div class="placeholder">
                                        <article>
                                            <img src="<php>echo '/'.C('UPLOADPATH').$coupon['promotion_img']</php>" />
                                            <samp>{$coupon['coupon_name']}</samp>
                                        </article>
                                        <article>
                                            <span>{$coupon['exintegral']}<i class="icon iconfont icon-credit"></i></span>
                                            <p>{$coupon['title']}</p>
                                            <a href="{:U('Member/welfareDetail',array('couponid'=>$coupon['id']))}" class="weui-btn">兑换</a>
                                        </article>
                                    </div>
                                </div>
                            </volist>
                        </div>
                        <!--list end-->
                    </div>
                </div>
                <tc_include file="Public:menu" />
            </div>
        </div>
    </div>
</div>
<tc_include file="Public:footer" />
<script>
    $(function(){
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination',
            slidesPerView: 1,
            paginationClickable: true,
            spaceBetween: 0,
            loop: true,
            autoplay : 2000
        });

        $("div[name=btn_sort]").click(function () {
            var sort = $(this).attr('sort');
            location.href='/index.php/member/memberwelfare?sort='+sort;
        });
    });
</script>